import Vue from 'vue'
import Router from 'vue-router'


Vue.use(Router)

export default new Router({
  mode:'history',
  routes: [
    {
      path: '/test',
      name: 'Test',
      component: ()=>import('@/views/test')
    },
    {
      path:'/index',
      name:'Index',
      component: ()=>import('@/views/Index')
    },{
      path: '/login',
      name: 'Login',
      component: ()=>import('@/views/Login')
    },
    {
      path: '/',
      redirect:'/index',
    },
    {
      path: '/long',
      name: 'Long',
      component: ()=>import('@/views/Long')
    },{
      path: '/activity',
      name: 'Activity',
      component: ()=>import('@/views/Activity')
    },{
      path: '/point',
      name: 'Point',
      component: ()=>import('@/views/Point')
    },{
      path: '/order',
      name: 'Order',
      component: ()=>import('@/views/Order'),
      redirect: '/online',
      children: [
        {
          path: '/online',
          name: 'Online',
          component: ()=>import('@/views/Online'),
        },{
          path: '/relation',
          name: 'Relation',
          component: ()=>import('@/views/Relation'),
        }
      ]
    },{
      path: '/item',
      name: 'Item',
      component: ()=>import('@/views/Item')
    },{
      path: '/rent',
      name: 'Rent',
      component: ()=>import('@/views/Rent')
    },
    {
      path: '*',
      name: '404',
      component:()=>import('@/views/404')
    },
    {
      path: '/admin',
      name: 'Admin',
      component: () => import('@/views/admin/Admin'),
    },
    {
      path: '/main',
      name: 'Main',
      component:()=>import('@/views/admin/Main'),
      children:[
        {
          path: '/car',
          name:'Car',
          component: ()=>import('@/views/admin/Car')
        },
        {
          path: '/user',
          name: 'User',
          component: ()=>import('@/views/admin/User')
        },{
          path: '/notice',
          name: 'Notice',
          component: ()=>import('@/views/admin/Notice')
        },{
          path: '/role',
          name: 'Role',
          component: ()=>import('@/views/admin/Role')
        },
        {
          path: '/message',
          name: 'Message',
          component: ()=>import('@/views/admin/Message')
        }
      ]
    }
  ]
})
